package com.zztt.logmask.common.handle;

import com.zztt.logmask.common.utils.MaskType;

/**
 * 手机号的掩码处理类
 */
public class PhoneMaskHandle extends AbstractRegExMaskHandle {

    /**
     * 手机号的正则表达式
     */
    private static final String PHONE_REG_EX="((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}";

    public PhoneMaskHandle(){
        super(PHONE_REG_EX);
    }

    public PhoneMaskHandle(String regEx){
        super(regEx);
    }

    @Override
    protected String maskStr(String matchStr) {
        return MaskType.MOBILE.mask(matchStr);
    }
}
